#pragma once

#include <iostream>
#include <unistd.h>
#include <functional>

typedef std::function<void (int, std::string&, uint16_t&)> func_t;

class Task
{
public:
    Task(){}
    Task(int sock, const std::string& ip, const uint16_t port, func_t func)
        :_sock(sock)
        ,_ip(ip)
        ,_port(port)
        ,_func(func)
    {}
    void operator()()
    {
        _func(_sock, _ip, _port);
    }    
public:
    int _sock;
    std::string _ip;
    uint16_t _port;
    func_t _func;
};